<template>
	<view>
		<view style="background-color: white;" v-if="list">
			<u-cell-group   title="代驾记录">
				<u-cell-item :title="item.valet_name" :value="item.valet_source==1?'内部员工':'外部代驾'" v-for="item in list"  :arrow="true">
					<view slot="label" >
						<view v-if="item.valet_expect_statrtDate!=null" style="display: flex;">
							<view >{{$u.timeFormat(item.valet_expect_statrtDate, 'mm-dd hh:MM')  }}</view>
							<view style="margin: 0 10rpx;">至</view>
							<view v-if="item.valet_expect_endDate">{{$u.timeFormat(item.valet_expect_endDate, 'mm-dd hh:MM')  }}</view>
							<view v-else>现在</view>
							<view style="margin: 0 10rpx;">|</view>
							<view>
								{{strDateToTime2($u.timeFormat(item.valet_expect_statrtDate, 'yyyy-mm-dd hh:MM'),$u.timeFormat(item.valet_expect_endDate||new Date(), 'yyyy-mm-dd hh:MM'))}}
							</view>
						</view>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>
		<view v-else>
			<u-empty text="空空如也" mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
	import dateUtils from '../../utils/dateUtils';
	export default {
		data() {
			return {
				list:null
			}
		},
		onLoad(options) {
			this.list=JSON.parse(decodeURIComponent(options.list));
		},
		methods: {
			strDateToTime2(take_date, return_date) {
				return dateUtils.strDateToTime2(take_date, return_date);
			},
		}
	}
</script>

<style>

</style>
